package com.plugin.core.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 系统菜单表
 * 
 * @author mark
 * @date 2025-07-28
 */
@Data
@TableName("sys_menu")
@Schema(description = "系统菜单实体")
public class SysMenu {

    @Schema(description = "菜单ID")
    @TableId(value = "menu_id", type = IdType.AUTO)
    private Long menuId;

    @Schema(description = "菜单名称")
    @TableField("menu_name")
    private String menuName;

    @Schema(description = "菜单标题")
    @TableField("title")
    private String title;

    @Schema(description = "父菜单ID，顶级为0")
    @TableField("parent_id")
    private Long parentId;

    @Schema(description = "显示顺序")
    @TableField("order_num")
    private Integer orderNum;

    @Schema(description = "路由地址")
    @TableField("path")
    private String path;

    @Schema(description = "组件路径")
    @TableField("component")
    private String component;

    @Schema(description = "路由参数")
    @TableField("query")
    private String query;

    @Schema(description = "路由名称")
    @TableField("route_name")
    private String routeName;

    @Schema(description = "跳转URL")
    @TableField("jump")
    private String jump;

    @Schema(description = "权限标识")
    @TableField("perms")
    private String perms;

    @Schema(description = "权限名称，以ROLE_开头")
    @TableField("perm_name")
    private String permName;

    @Schema(description = "权限URL，如：mch_info/**")
    @TableField("perm_url")
    private String permUrl;

    @Schema(description = "菜单类型（M目录 C菜单 F按钮）")
    @TableField("menu_type")
    private String menuType;

    @Schema(description = "资源类型（1菜单 2按钮）")
    @TableField("type")
    private Integer type;

    @Schema(description = "是否为外链（0是 1否）")
    @TableField("is_frame")
    private Integer isFrame;

    @Schema(description = "是否缓存（0缓存 1不缓存）")
    @TableField("is_cache")
    private Integer isCache;

    @Schema(description = "菜单状态（0显示 1隐藏）")
    @TableField("visible")
    private String visible;

    @Schema(description = "菜单状态（0正常 1停用）")
    @TableField("status")
    private String status;

    @Schema(description = "所属系统（1健康管理 2长者服务 3膳食管理 4系统管理）")
    @TableField("system")
    private Integer system;

    @Schema(description = "菜单图标")
    @TableField("icon")
    private String icon;

    @Schema(description = "属性，为空都可见，否则对应用户类型")
    @TableField("property")
    private String property;

    @Schema(description = "创建者")
    @TableField("create_by")
    private String createBy;

    @Schema(description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "更新者")
    @TableField("update_by")
    private String updateBy;

    @Schema(description = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @Schema(description = "备注")
    @TableField("remark")
    private String remark;
}
